import java.util.Scanner;

public class Hello {
    public static void main(String[] args) {
        int count = 0;
        System.out.println("请输入1或0：(1表示有上班，0表示休假或旷工)");
            for (int i = 1; i <= 7; i++) {
                Scanner sc  =new Scanner(System.in);
                System.out.println("请输入第"+i+"天上班情况");
                int a  = sc.nextInt();
                if (a!=1&&a!=0){
                    System.out.println("您输入的有误，请重新输入！");
                    i--;
                    continue;
                }
                if (a==1){
                    count++;
                }
            }
            System.out.println("本周共出勤"+count+"天");
        }
    }

